home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / MoreFiles 1.2.1 / MoreFilesExtras.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-09  |  55.3 KB  |  1,594 lines  |  [TEXT/KAHL]

  1. /*
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    A collection of useful high-level File Manager routines.
  5. **
  6. **    by Jim Luther, Apple Developer Technical Support
  7. **
  8. **    File:        MoreFilesExtras.h
  9. **
  10. **    Copyright © 1992-1994 Apple Computer, Inc.
  11. **    All rights reserved.
  12. **
  13. **    You may incorporate this sample code into your applications without
  14. **    restriction, though the sample code has been provided "AS IS" and the
  15. **    responsibility for its operation is 100% yours.  However, what you are
  16. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  17. **    after having made changes. If you're going to re-distribute the source,
  18. **    we require that you make it clear in the source that the code was
  19. **    descended from Apple Sample Code, but that you've made changes.
  20. */
  21.  
  22. #ifndef __MOREFILESEXTRAS__
  23. #define __MOREFILESEXTRAS__
  24.  
  25.  
  26. #ifndef __TYPES__
  27. #include <Types.h>
  28. #endif
  29.  
  30. #ifndef __ERRORS__
  31. #include <Errors.h>
  32. #endif
  33.  
  34. #ifndef __MEMORY__
  35. #include <Memory.h>
  36. #endif
  37.  
  38. #ifndef __OSUTILS__
  39. #include <OSUtils.h>
  40. #endif
  41.  
  42. #ifndef __FILES__
  43. #include <Files.h>
  44. #endif
  45.  
  46. #ifndef __FOLDERS__
  47. #include <Folders.h>
  48. #endif
  49.  
  50. #ifndef __MOREFILES__
  51. #include "MoreFiles.h"
  52. #endif
  53.  
  54. #ifndef __SEARCH__
  55. #include "Search.h"
  56. #endif
  57.  
  58. /*    Sharing.h should be in Files.h, but isn't yet... */
  59. //#ifndef __SHARING__
  60. //#include "Sharing.h"
  61. //#endif
  62.  
  63.  
  64. /*
  65. **    Macros to get information out of GetVolParmsInfoBuffer
  66. */
  67.  
  68. #define    isNetworkVolume(volParms)    ((volParms).vMServerAdr != 0)
  69. #define    hasLimitFCBs(volParms)        (((volParms).vMAttrib & (1L << bLimitFCBs)) != 0)
  70. #define    hasLocalWList(volParms)        (((volParms).vMAttrib & (1L << bLocalWList)) != 0)
  71. #define    hasNoMiniFndr(volParms)        (((volParms).vMAttrib & (1L << bNoMiniFndr)) != 0)
  72. #define hasNoVNEdit(volParms)        (((volParms).vMAttrib & (1L << bNoVNEdit)) != 0)
  73. #define hasNoLclSync(volParms)        (((volParms).vMAttrib & (1L << bNoLclSync)) != 0)
  74. #define hasTrshOffLine(volParms)    (((volParms).vMAttrib & (1L << bTrshOffLine)) != 0)
  75. #define hasNoSwitchTo(volParms)        (((volParms).vMAttrib & (1L << bNoSwitchTo)) != 0)
  76. #define hasNoDeskItems(volParms)    (((volParms).vMAttrib & (1L << bNoDeskItems)) != 0)
  77. #define hasNoBootBlks(volParms)        (((volParms).vMAttrib & (1L << bNoBootBlks)) != 0)
  78. #define hasAccessCntl(volParms)        (((volParms).vMAttrib & (1L << bAccessCntl)) != 0)
  79. #define hasNoSysDir(volParms)        (((volParms).vMAttrib & (1L << bNoSysDir)) != 0)
  80. #define hasExtFSVol(volParms)        (((volParms).vMAttrib & (1L << bHasExtFSVol)) != 0)
  81. #define hasOpenDeny(volParms)        (((volParms).vMAttrib & (1L << bHasOpenDeny)) != 0)
  82. #define hasCopyFile(volParms)        (((volParms).vMAttrib & (1L << bHasCopyFile)) != 0)
  83. #define hasMoveRename(volParms)        (((volParms).vMAttrib & (1L << bHasMoveRename)) != 0)
  84. #define hasDesktopMgr(volParms)        (((volParms).vMAttrib & (1L << bHasDesktopMgr)) != 0)
  85. #define hasShortName(volParms)        (((volParms).vMAttrib & (1L << bHasShortName)) != 0)
  86. #define hasFolderLock(volParms)        (((volParms).vMAttrib & (1L << bHasFolderLock)) != 0)
  87. #define hasPersonalAccessPrivileges(volParms) \
  88.         (((volParms).vMAttrib & (1L << bHasPersonalAccessPrivileges)) != 0)
  89. #define hasUserGroupList(volParms)    (((volParms).vMAttrib & (1L << bHasUserGroupList)) != 0)
  90. #define hasCatSearch(volParms)        (((volParms).vMAttrib & (1L << bHasCatSearch)) != 0)
  91. #define hasFileIDs(volParms)        (((volParms).vMAttrib & (1L << bHasFileIDs)) != 0)
  92. #define hasBTreeMgr(volParms)        (((volParms).vMAttrib & (1L << bHasBTreeMgr)) != 0)
  93. #define hasBlankAccessPrivileges(volParms) \
  94.         (((volParms).vMAttrib & (1L << bHasBlankAccessPrivileges)) != 0)
  95.  
  96. /*
  97. **    Deny mode permissions for use with the HOpenAware, HOpenRFAware,
  98. **    FSpOpenAware, and FSpOpenRFAware functions.
  99. */
  100.  
  101. enum
  102. {
  103.     dmNone            = 0x0000,
  104.     dmNoneDenyRd    = 0x0010,
  105.     dmNoneDenyWr    = 0x0020,
  106.     dmNoneDenyRdWr    = 0x0030,
  107.     dmRd            = 0x0001,    /* Single writer, multiple readers; the readers */
  108.     dmRdDenyRd        = 0x0011,
  109.     dmRdDenyWr        = 0x0021,    /* Browsing - equivalent to fsRdPerm */
  110.     dmRdDenyRdWr    = 0x0031,
  111.     dmWr            = 0x0002,
  112.     dmWrDenyRd        = 0x0012,
  113.     dmWrDenyWr        = 0x0022,
  114.     dmWrDenyRdWr    = 0x0032,
  115.     dmRdWr            = 0x0003,    /* Shared access - equivalent to fsRdWrShPerm */
  116.     dmRdWrDenyRd    = 0x0013,
  117.     dmRdWrDenyWr    = 0x0023,    /* Single writer, multiple readers; the writer */
  118.     dmRdWrDenyRdWr    = 0x0033    /* Exclusive access - equivalent to fsRdWrPerm */
  119. };
  120.     
  121.  
  122. /*
  123. **    For those times where you need to use more than one kind of File Manager parameter
  124. **    block but don't feel like wasting stack space, here's a parameter block you can reuse.
  125. */
  126.  
  127. #if defined(powerc) || defined (__powerc)
  128. #pragma options align=mac68k
  129. #endif
  130. union UniversalFMPB
  131. {
  132.     ParamBlockRec    PB;
  133.     CInfoPBRec        ciPB;
  134.     DTPBRec            dtPB;
  135.     HParamBlockRec    hPB;
  136.     CMovePBRec        cmPB;
  137.     WDPBRec            wdPB;
  138.     FCBPBRec        fcbPB;
  139. };
  140. #if defined(powerc) || defined(__powerc)
  141. #pragma options align=reset
  142. #endif
  143.  
  144. typedef union UniversalFMPB UniversalFMPB;
  145. typedef UniversalFMPB *UniversalFMPBPtr, **UniversalFMPBHandle;
  146.  
  147.  
  148. /*
  149. **    Used by GetUGEntries to return user or group lists
  150. */
  151.  
  152. #if defined(powerc) || defined (__powerc)
  153. #pragma options align=mac68k
  154. #endif
  155. struct UGEntry
  156. {
  157.     short    objType;    /* object type: -1 = group; 0 = user */
  158.     long    objID;        /* the user or group ID */
  159.     Str31    name;        /* the user or group name */
  160. };
  161. #if defined(powerc) || defined(__powerc)
  162. #pragma options align=reset
  163. #endif
  164.  
  165. typedef struct UGEntry UGEntry;
  166. typedef UGEntry *UGEntryPtr, **UGEntryHandle;
  167.  
  168.  
  169. typedef unsigned char Str8[9];
  170.  
  171.  
  172. /*
  173. **    I use the following record instead of the AFPVolMountInfo structure in Files.h
  174. */
  175.  
  176. #if defined(powerc) || defined (__powerc)
  177. #pragma options align=mac68k
  178. #endif
  179. struct MyAFPVolMountInfo
  180. {
  181.     short length;                /* length of this record */
  182.     VolumeType media;            /* type of media, always AppleShareMediaType */
  183.     short flags;                /* 0 = normal mount; set bit 0 to inhibit greeting messages */
  184.     char nbpInterval;            /* NBP interval parameter; 7 is a good choice */
  185.     char nbpCount;                /* NBP count parameter; 5 is a good choice */
  186.     short uamType;                /* User Authentication Method */
  187.     short zoneNameOffset;        /* offset from start of record to zoneName */
  188.     short serverNameOffset;        /* offset from start of record to serverName */
  189.     short volNameOffset;        /* offset from start of record to volName */
  190.     short userNameOffset;        /* offset from start of record to userName */
  191.     short userPasswordOffset;    /* offset from start of record to userPassword */
  192.     short volPasswordOffset;    /* offset from start of record to volPassword */
  193.     Str31 zoneName;                /* server's AppleTalk zone name */                    
  194.     Str31 serverName;            /* server name */                    
  195.     Str27 volName;                /* volume name */                    
  196.     Str31 userName;                /* user name (zero length Pascal string for guest) */
  197.     Str8 userPassword;            /* user password (zero length Pascal string if no user password) */                    
  198.     char filler1;                /* to word align volPassword */
  199.     Str8 volPassword;            /* volume password (zero length Pascal string if no volume password) */                    
  200.     char filler2;                /* to end record on word boundry */
  201. };
  202. #if defined(powerc) || defined(__powerc)
  203. #pragma options align=reset
  204. #endif
  205.  
  206. typedef struct MyAFPVolMountInfo MyAFPVolMountInfo;
  207. typedef MyAFPVolMountInfo *MyAFPVolMountInfoPtr, **MyAFPVolMountInfoHandle;
  208.  
  209.  
  210. /*****************************************************************************/
  211.  
  212. pascal    OSErr    NameFileSearch(StringPtr volName,
  213.                                short vRefNum,
  214.                                ConstStr255Param fileName,
  215.                                FSSpecPtr matches,
  216.                                long reqMatchCount,
  217.                                long *actMatchCount,
  218.                                Boolean newSearch,
  219.                                Boolean partial);
  220. /*    ¶ Search for files by file name with PBCatSearch.
  221.     The NameFileSearch function searches for files with a specific file
  222.     name on a volume that supports PBCatSearch.
  223.     Note: A result of catChangedErr means the catalog has changed between
  224.     searches, but the search can be continued with the possiblity that you
  225.     may miss some matches or get duplicate matches.  For all other results
  226.     (except for noErr), the search cannot be continued.
  227.  
  228.     volName            input:    A pointer to the name of a mounted volume
  229.                             or nil.
  230.     vRefNum            input:    Volume specification.
  231.     fileName        input:    The name of the file to search for.
  232.     matches            input:    Pointer to array of FSSpec where the match list is
  233.                             returned.
  234.     reqMatchCount    input:    Maximum number of matches to return    (the number of
  235.                             elements in the matches array).
  236.     actMatchCount    output: The number of matches actually returned.
  237.     newSearch        input:    If true, start a new search. If false and if
  238.                             vRefNum is the same as the last call to
  239.                             NameFileSearch, then start searching at the
  240.                             position where the last search left off.
  241.     partial            input:    If the partial parameter is false, then only files
  242.                             that exactly match fileName will be found.  If the
  243.                             partial parameter is true, then all file names that
  244.                             contain fileName will be found.
  245.  
  246.     __________
  247.     
  248.     Also see:    CreatorTypeFileSearch
  249. */
  250.  
  251. /*****************************************************************************/
  252.  
  253. pascal    OSErr    CreatorTypeFileSearch(StringPtr volName,
  254.                                       short vRefNum,
  255.                                       OSType creator,
  256.                                       OSType fileType,
  257.                                       FSSpecPtr matches,
  258.                                       long reqMatchCount,
  259.                                       long *actMatchCount,
  260.                                       Boolean newSearch);
  261. /*    ¶ Search for files by creator/fileType with PBCatSearch.
  262.     The CreatorTypeFileSearch function searches for files with a specific
  263.     creator or fileType on a volume that supports PBCatSearch.
  264.     Note: A result of catChangedErr means the catalog has changed between
  265.     searches, but the search can be continued with the possiblity that you
  266.     may miss some matches or get duplicate matches.  For all other results
  267.     (except for noErr), the search cannot be continued.
  268.  
  269.     volName            input:    A pointer to the name of a mounted volume
  270.                             or nil.
  271.     vRefNum            input:    Volume specification.
  272.     creator            input:    The creator type of the file to search for.
  273.                             To ignore the creator type, pass 0x00000000 in
  274.                             this field.
  275.     fileType        input:    The file type of the file to search for.
  276.                             To ignore the file type, pass 0x00000000 in
  277.                             this field.
  278.     matches            input:    Pointer to array of FSSpec where the match list is
  279.                             returned.
  280.     reqMatchCount    input:    Maximum number of matches to return    (the number of
  281.                             elements in the matches array).
  282.     actMatchCount    output: The number of matches actually returned.
  283.     newSearch        input:    If true, start a new search. If false and if
  284.                             vRefNum is the same as the last call to
  285.                             CreatorTypeFileSearch, then start searching at the
  286.                             position where the last search left off.
  287.  
  288.     __________
  289.     
  290.     Also see:    NameFileSearch
  291. */
  292.  
  293. /*****************************************************************************/
  294.  
  295. pascal    OSErr    DetermineVRefNum(StringPtr pathname,
  296.                                  short vRefNum,
  297.                                  short *realVRefNum);
  298. /*    ¶ Determine the real volume reference number.
  299.     The DetermineVRefNum function determines the volume reference number of
  300.     a volume from a pathname, a volume specification, or a combination
  301.     of the two.
  302.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  303.     mounted volumes can have the same name. For this reason, the use of a
  304.     volume name or full pathname to identify a specific volume may not
  305.     produce the results you expect.  If more than one volume has the same
  306.     name and a volume name or full pathname is used, the File Manager
  307.     currently uses the first volume it finds with a matching name in the
  308.     volume queue.
  309.  
  310.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  311.                         partial pathname, it is ignored. A full pathname to a
  312.                         volume must end with a colon character (:).
  313.     vRefNum        input:    Volume specification (volume reference number, working
  314.                         directory number, drive number, or 0).
  315.     realVRefNum    output:    The real volume reference number.
  316. */
  317.  
  318. /*****************************************************************************/
  319.  
  320. pascal    OSErr    HGetVInfo(short volReference,
  321.                           StringPtr volName,
  322.                           short *vRefNum,
  323.                           unsigned long *freeBytes,
  324.                           unsigned long *totalBytes);
  325. /*    ¶ Get information about a mounted volume.
  326.     The HGetVInfo function returns the name, volume reference number,
  327.     available space (in bytes), and total space (in bytes) for the
  328.     specified volume. You can specify the volume by providing its drive
  329.     number, volume reference number, or 0 for the default volume.
  330.     This routine is compatible with volumes up to 4 gigabytes.
  331.     
  332.     volReference    input:    The drive number, volume reference number,
  333.                             or 0 for the default volume.
  334.     volName            input:    A pointer to a buffer (minimum Str27) where
  335.                             the volume name is to be returned or must
  336.                             be nil.
  337.                     output:    The volume name.
  338.     vRefNum            output:    The volume reference number.
  339.     freeBytes        output:    The number of free bytes on the volume.
  340.                             freeBytes is an unsigned long value.
  341.     totalBytes        output:    The total number of bytes on the volume.
  342.                             totalBytes is an unsigned long value.
  343. */
  344.  
  345. /*****************************************************************************/
  346.  
  347. pascal    OSErr    CheckVolLock(StringPtr pathname,
  348.                              short vRefNum);
  349. /*    ¶ Determine if a volume is locked.
  350.     The CheckVolLock function determines if a volume is locked - either by
  351.     hardware or by software. If CheckVolLock returns noErr, then the volume
  352.     is not locked.
  353.  
  354.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  355.                         partial pathname, it is ignored. A full pathname to a
  356.                         volume must end with a colon character (:).
  357.     vRefNum        input:    Volume specification (volume reference number, working
  358.                         directory number, drive number, or 0).
  359. */
  360.  
  361. /*****************************************************************************/
  362.  
  363. pascal    OSErr    UnmountAndEject(StringPtr pathname,
  364.                                 short vRefNum);
  365. /*    ¶ Unmount and eject a volume.
  366.     The UnmountAndEject function unmounts and ejects a volume. The volume
  367.     is ejected only if it is ejectable and not already ejected.
  368.     
  369.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  370.                         partial pathname, it is ignored. A full pathname to a
  371.                         volume must end with a colon character (:).
  372.     vRefNum        input:    Volume specification (volume reference number, working
  373.                         directory number, drive number, or 0).
  374. */
  375.  
  376. /*****************************************************************************/
  377.  
  378. pascal    OSErr    OnLine(FSSpecPtr volumes,
  379.                        short reqVolCount,
  380.                        short *actVolCount,
  381.                        short *volIndex);
  382. /*    ¶ Return the list of volumes currently mounted.
  383.     The OnLine function returns the list of volumes currently mounted in
  384.     an array of FSSpec records.
  385.  
  386.     volumes        input:    Pointer to array of FSSpec where the volume list
  387.                         is returned.
  388.     reqVolCount    input:    Maximum number of volumes to return    (the number of
  389.                         elements in the volumes array).
  390.     actVolCount    output: The number of volumes actually returned.
  391.     volIndex    input:    The current volume index position. Set to 1 to
  392.                         start with the first volume.
  393.                 output:    The volume index position to get the next volume.
  394.                         Pass this value the next time you call OnLine to
  395.                         start where you left off.
  396. */
  397.  
  398. /*****************************************************************************/
  399.  
  400. pascal    OSErr GetDInfo(short vRefNum,
  401.                        long dirID,
  402.                        StringPtr name,
  403.                        DInfo *fndrInfo);
  404. /*    ¶ Get the finder information for a directory.
  405.     The GetDInfo function gets the finder information for a directory.
  406.  
  407.     vRefNum            input:    Volume specification.
  408.     dirID            input:    Directory ID.
  409.     name            input:    Pointer to object name, or nil when dirID
  410.                             specifies a directory that's the object.
  411.     fndrInfo        output:    If the object is a directory, then its DInfo.
  412.  
  413.     __________
  414.     
  415.     Also see:    FSpGetDInfo,
  416. */
  417.  
  418. /*****************************************************************************/
  419.  
  420. pascal    OSErr FSpGetDInfo(const FSSpec *spec,
  421.                           DInfo *fndrInfo);
  422. /*    ¶ Get the finder information for a directory.
  423.     The FSpGetDInfo function gets the finder information for a directory.
  424.  
  425.     spec        input:    An FSSpec record specifying the directory.
  426.     fndrInfo    output:    If the object is a directory, then its DInfo.
  427.  
  428.     __________
  429.     
  430.     Also see:    FSpGetFInfoCompat, GetDInfo
  431. */
  432.  
  433. /*****************************************************************************/
  434.  
  435. pascal    OSErr SetDInfo(short vRefNum,
  436.                        long dirID,
  437.                        StringPtr name,
  438.                        const DInfo *fndrInfo);
  439. /*    ¶ Set the finder information for a directory.
  440.     The SetDInfo function sets the finder information for a directory.
  441.  
  442.     vRefNum            input:    Volume specification.
  443.     dirID            input:    Directory ID.
  444.     name            input:    Pointer to object name, or nil when dirID
  445.                             specifies a directory that's the object.
  446.     fndrInfo        input:    The DInfo.
  447.  
  448.     __________
  449.     
  450.     Also see:    FSpSetDInfo,
  451. */
  452.  
  453. /*****************************************************************************/
  454.  
  455. pascal    OSErr FSpSetDInfo(const FSSpec *spec,
  456.                           const DInfo *fndrInfo);
  457. /*    ¶ Set the finder information for a directory.
  458.     The FSpSetDInfo function sets the finder information for a directory.
  459.  
  460.     spec        input:    An FSSpec record specifying the directory.
  461.     fndrInfo    input:    The DInfo.
  462.  
  463.     __________
  464.     
  465.     Also see:    FSpSetFInfoCompat, SetDInfo
  466. */
  467.  
  468. /*****************************************************************************/
  469.  
  470. pascal    OSErr    GetDirID(short vRefNum,
  471.                          long dirID,
  472.                          StringPtr name,
  473.                          long *theDirID,
  474.                          Boolean *isDirectory);
  475. /*    ¶ Get the directory ID number of the directory specified.
  476.     The GetDirID function gets the directory ID number of the directory
  477.     specified.  If a file is specified, then the parent
  478.     directory of the file is returned and isDirectory is false.  If
  479.     a directory is specified, then that directory's ID number is
  480.     returned and isDirectory is true.
  481.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  482.     mounted volumes can have the same name. For this reason, the use of a
  483.     volume name or full pathname to identify a specific volume may not
  484.     produce the results you expect.  If more than one volume has the same
  485.     name and a volume name or full pathname is used, the File Manager
  486.     currently uses the first volume it finds with a matching name in the
  487.     volume queue.
  488.     
  489.     vRefNum            input:    Volume specification.
  490.     dirID            input:    Directory ID.
  491.     name            input:    Pointer to object name, or nil when dirID
  492.                             specifies a directory that's the object.
  493.     theDirID        output:    If the object is a file, then its parent directory
  494.                             ID. If the object is a directory, then its ID.
  495.     isDirectory        output:    True if object is a directory; false if
  496.                             object is a file.
  497. */
  498.  
  499. /*****************************************************************************/
  500.  
  501. pascal    OSErr    DirIDFromFSSpec(const FSSpec *spec,
  502.                                 long *dirID,
  503.                                 Boolean *isDirectory);
  504. /*    ¶ Get the directory ID number of a directory.
  505.     The DirIDFromFSSpec function gets the directory ID number of the
  506.     directory specified by spec. If spec is to a file, then the parent
  507.     directory of the file is returned and isDirectory is false.  If
  508.     spec is to a directory, then that directory's ID number is
  509.     returned and isDirectory is true.
  510.     
  511.     spec            input:    An FSSpec record specifying the directory.
  512.     theDirID        output:    The directory ID.
  513.     isDirectory        output:    True if object is a directory; false if
  514.                             object is a file.
  515. */
  516.  
  517. /*****************************************************************************/
  518.  
  519. pascal    OSErr    GetDirName(short vRefNum,
  520.                            long dirID,
  521.                            StringPtr name);
  522. /*    ¶ Get the name of a directory from its directory ID.
  523.     The GetDirName function gets the name of a directory from its
  524.     directory ID.
  525.  
  526.     vRefNum        input:    Volume specification.
  527.     dirID        input:    Directory ID.
  528.     name        output:    Points to a buffer (minimum Str63) where the
  529.                         directory name is to be returned or must be nil.
  530. */
  531.  
  532. /*****************************************************************************/
  533.  
  534. pascal    OSErr    GetParentID(short vRefNum,
  535.                             long dirID,
  536.                             StringPtr name,
  537.                             long *parID);
  538. /*    ¶ Get the parent directory ID number of the specified object.
  539.     The GetParentID function gets the parent directory ID number of the
  540.     specified object.
  541.     
  542.     vRefNum        input:    Volume specification.
  543.     dirID        input:    Directory ID.
  544.     name        input:    Pointer to object name, or nil when dirID specifies
  545.                         a directory that's the object.
  546.     parID        output:    The parent directory ID of the specified object.
  547. */
  548.  
  549. /*****************************************************************************/
  550.  
  551. pascal    OSErr    GetFilenameFromPathname(ConstStr255Param pathname,
  552.                                         Str255 filename);
  553. /*    ¶ Get the object name from the end of a full or partial pathname.
  554.     The GetFilenameFromPathname function gets the file (or directory) name
  555.     from the end of a full or partial pathname. Returns notAFileErr if the
  556.     pathname is nil, the pathname is empty, or the pathname cannot refer to
  557.     a filename (with a noErr result, the pathname could still refer to a
  558.     directory).
  559.     
  560.     pathname    input:    A full or partial pathname.
  561.     filename    output:    The file (or directory) name.
  562.  
  563.     __________
  564.     
  565.     See also:    GetObjectLocation.
  566. */
  567.  
  568. /*****************************************************************************/
  569.  
  570. pascal    OSErr    GetObjectLocation(short vRefNum,
  571.                                   long dirID,
  572.                                   StringPtr pathname,
  573.                                   short *realVRefNum,
  574.                                   long *realParID,
  575.                                   Str255 realName,
  576.                                   Boolean *isDirectory);
  577. /*    ¶ Get a file system object's location.
  578.     The GetObjectLocation function gets a file system object's location -
  579.     that is, its real volume reference number, real parent directory ID,
  580.     and name. While we're at it, determine if the object is a file or directory.
  581.     If GetObjectLocation returns fnfErr, then the location information
  582.     returned is valid, but it describes an object that doesn't exist.
  583.     You can use the location information for another operation, such as
  584.     creating a file or directory.
  585.     
  586.     vRefNum        input:    Volume specification.
  587.     dirID        input:    Directory ID.
  588.     pathname    input:    Pointer to object name, or nil when dirID specifies
  589.                         a directory that's the object.
  590.     realVRefNum    output:    The real volume reference number.
  591.     realParID    output:    The parent directory ID of the specified object.
  592.     realName    output:    The name of the specified object (the case of the
  593.                         object name may not be the same as the object's
  594.                         catalog entry on disk - since the Macintosh file
  595.                         system is not case sensitive, it shouldn't matter).
  596.     isDirectory    output:    True if object is a directory; false if object
  597.                         is a file.
  598.  
  599.     __________
  600.     
  601.     See also:    FSMakeFSSpecCompat
  602. */
  603.  
  604. /*****************************************************************************/
  605.  
  606. pascal    OSErr    GetDirItems(short vRefNum,
  607.                             long dirID,
  608.                             StringPtr name,
  609.                             Boolean getFiles,
  610.                             Boolean getDirectories,
  611.                             FSSpecPtr items,
  612.                             short reqItemCount,
  613.                             short *actItemCount,
  614.                             short *itemIndex);
  615. /*    ¶ Return a list of items in a directory.
  616.     The GetDirItems function returns a list of items in the specified
  617.     directory in an array of FSSpec records. File, subdirectories, or
  618.     both can be returned in the list.
  619.  
  620.     vRefNum            input:    Volume specification.
  621.     dirID            input:    Directory ID.
  622.     name            input:    Pointer to object name, or nil when dirID
  623.                             specifies a directory that's the object.
  624.     getFiles        input:    Pass true to have files added to the items list.
  625.     getDirectories    input:    Pass true to have directories added to the
  626.                             items list.
  627.     items            input:    Pointer to array of FSSpec where the item list
  628.                             is returned.
  629.     reqItemCount    input:    Maximum number of items to return (the number
  630.                             of elements in the items array).
  631.     actItemCount    output: The number of items actually returned.
  632.     itemIndex        input:    The current item index position. Set to 1 to
  633.                             start with the first item in the directory.
  634.                     output:    The item index position to get the next item.
  635.                             Pass this value the next time you call
  636.                             GetDirItems to start where you left off.
  637. */
  638.  
  639. /*****************************************************************************/
  640.  
  641. pascal    OSErr    DeleteDirectoryContents(short vRefNum,
  642.                                          long dirID,
  643.                                         StringPtr name);
  644. /*    ¶ Delete the contents of a directory.
  645.     The DeleteDirectoryContents function deletes the contents of a directory.
  646.     All files and subdirectories in the specified directory are deleted.
  647.     If a locked file or directory is encountered, it is unlocked and then
  648.     deleted.  If any unexpected errors are encountered,
  649.     DeleteDirectoryContents quits and returns to the caller.
  650.     
  651.     vRefNum    input:    Volume specification.
  652.     dirID    input:    Directory ID.
  653.     name    input:    Pointer to directory name, or nil when dirID specifies
  654.                     a directory that's the object.
  655.  
  656.     __________
  657.     
  658.     Also see:    DeleteDirectory
  659. */
  660.  
  661. /*****************************************************************************/
  662.  
  663. pascal    OSErr    DeleteDirectory(short vRefNum,
  664.                                 long dirID,
  665.                                 StringPtr name);
  666. /*    ¶ Delete a directory and its contents.
  667.     The DeleteDirectory function deletes a directory and its contents.
  668.     All files and subdirectories in the specified directory are deleted.
  669.     If a locked file or directory is encountered, it is unlocked and then
  670.     deleted.  After deleting the directories contents, the directory is
  671.     deleted. If any unexpected errors are encountered, DeleteDirectory
  672.     quits and returns to the caller.
  673.     
  674.     vRefNum    input:    Volume specification.
  675.     dirID    input:    Directory ID.
  676.     name    input:    Pointer to directory name, or nil when dirID specifies
  677.                     a directory that's the object.
  678.  
  679.     __________
  680.     
  681.     Also see:    DeleteDirectoryContents
  682. */
  683.  
  684. /*****************************************************************************/
  685.  
  686. pascal    OSErr    CheckObjectLock(short vRefNum,
  687.                                 long dirID,
  688.                                 StringPtr name);
  689. /*    ¶ Determine if a file or directory is locked.
  690.     The CheckObjectLock function determines if a file or directory is locked.
  691.     If CheckObjectLock returns noErr, then the file or directory
  692.     is not locked.
  693.     
  694.     vRefNum    input:    Volume specification.
  695.     dirID    input:    Directory ID.
  696.     name    input:    Pointer to object name, or nil when dirID specifies
  697.                     a directory that's the object.
  698.  
  699.     __________
  700.     
  701.     Also see:    FSpCheckObjectLock
  702. */
  703.  
  704. /*****************************************************************************/
  705.  
  706. pascal    OSErr    FSpCheckObjectLock(const FSSpec *spec);
  707. /*    ¶ Determine if a file or directory is locked.
  708.     The FSpCheckObjectLock function determines if a file or directory is locked.
  709.     If FSpCheckObjectLock returns noErr, then the file or directory
  710.     is not locked.
  711.     
  712.     spec    input:    An FSSpec record specifying the object.
  713.  
  714.     __________
  715.     
  716.     Also see:    CheckObjectLock
  717. */
  718.  
  719. /*****************************************************************************/
  720.  
  721. pascal    OSErr    BumpDate(short vRefNum,
  722.                          long dirID,
  723.                          StringPtr name);
  724. /*    ¶ Update the modification date of a file or directory.
  725.     The BumpDate function changes the modification date of a file or
  726.     directory to the current date/time.  If the modification date is already
  727.     equal to the current date/time, then add one second to the
  728.     modification date.
  729.     
  730.     vRefNum    input:    Volume specification.
  731.     dirID    input:    Directory ID.
  732.     name    input:    Pointer to object name, or nil when dirID specifies
  733.                     a directory that's the object.
  734.  
  735.     __________
  736.     
  737.     See also:    FSpBumpDate
  738. */
  739.  
  740. /*****************************************************************************/
  741.  
  742. pascal    OSErr    FSpBumpDate(const FSSpec *spec);
  743. /*    ¶ Update the modification date of a file or directory.
  744.     The FSpBumpDate function changes the modification date of a file or
  745.     directory to the current date/time.  If the modification date is already
  746.     equal to the current date/time, then add one second to the
  747.     modification date.
  748.     
  749.     spec    input:    An FSSpec record specifying the object.
  750.  
  751.     __________
  752.     
  753.     See also:    BumpDate
  754. */
  755.  
  756. /*****************************************************************************/
  757.  
  758. pascal    OSErr    ChangeCreatorType(short vRefNum,
  759.                                   long dirID,
  760.                                   ConstStr255Param name,
  761.                                   OSType creator,
  762.                                   OSType fileType);
  763. /*     ¶ Change the creator or file type of a file.
  764.     The ChangeCreatorType function changes the creator or file type of a file.
  765.  
  766.     vRefNum        input:    Volume specification.
  767.     dirID        input:    Directory ID.
  768.     name        input:    The name of the file.
  769.     creator        input:    The new creator type or 0x00000000 to leave
  770.                         the creator type alone.
  771.     fileType    input:    The new file type or 0x00000000 to leave the
  772.                         file type alone.
  773.  
  774.     __________
  775.     
  776.     See also:    FSpChangeCreatorType
  777. */
  778.  
  779. /*****************************************************************************/
  780.  
  781. pascal    OSErr    FSpChangeCreatorType(const FSSpec *spec,
  782.                                      OSType creator,
  783.                                      OSType fileType);
  784. /*    ¶ Change the creator or file type of a file.
  785.     The FSpChangeCreatorType function changes the creator or file type of a file.
  786.  
  787.     spec        input:    An FSSpec record specifying the file.
  788.     creator        input:    The new creator type or 0x00000000 to leave
  789.                         the creator type alone.
  790.     fileType    input:    The new file type or 0x00000000 to leave the
  791.                         file type alone.
  792.  
  793.     __________
  794.     
  795.     See also:    ChangeCreatorType
  796. */
  797.  
  798. /*****************************************************************************/
  799.  
  800. pascal    OSErr    ChangeFDFlags(short vRefNum,
  801.                               long dirID,
  802.                               StringPtr name,
  803.                               Boolean    setBits,
  804.                               unsigned short flagBits);
  805. /*    ¶ Set or clear Finder Flag bits.
  806.     The ChangeFDFlags function sets or clears Finder Flag bits in the
  807.     fdFlags field of a file or directory's FInfo record.
  808.     
  809.     vRefNum        input:    Volume specification.
  810.     dirID        input:    Directory ID.
  811.     name        input:    Pointer to object name, or nil when dirID specifies
  812.                         a directory that's the object.
  813.     setBits        input:    If true, then set the bits specified in flagBits.
  814.                         If false, then clear the bits specified in flagBits.
  815.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  816.                         bits to set or clear. If a bit in flagBits is set,
  817.                         then the same bit in fdFlags is either set or
  818.                         cleared depending on the state of the setBits
  819.                         parameter.
  820.  
  821.     __________
  822.     
  823.     See also:    FSpChangeFDFlags
  824. */
  825.  
  826. /*****************************************************************************/
  827.  
  828. pascal    OSErr    FSpChangeFDFlags(const FSSpec *spec,
  829.                                  Boolean setBits,
  830.                                  unsigned short flagBits);
  831. /*    ¶ Set or clear Finder Flag bits.
  832.     The FSpChangeFDFlags function sets or clears Finder Flag bits in the
  833.     fdFlags field of a file or directory's FInfo record.
  834.     
  835.     spec        input:    An FSSpec record specifying the object.
  836.     setBits        input:    If true, then set the bits specified in flagBits.
  837.                         If false, then clear the bits specified in flagBits.
  838.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  839.                         bits to set or clear. If a bit in flagBits is set,
  840.                         then the same bit in fdFlags is either set or
  841.                         cleared depending on the state of the setBits
  842.                         parameter.
  843.  
  844.     __________
  845.     
  846.     See also:    ChangeFDFlags
  847. */
  848.  
  849. /*****************************************************************************/
  850.  
  851. pascal    OSErr    SetIsInvisible(short vRefNum,
  852.                                long dirID,
  853.                                StringPtr name);
  854. /*    ¶ Set the invisible Finder Flag bit.
  855.     The SetIsInvisible function sets the invisible bit in the fdFlags
  856.     word of the specified file or directory's finder information.
  857.     
  858.     vRefNum    input:    Volume specification.
  859.     dirID    input:    Directory ID.
  860.     name    input:    Pointer to object name, or nil when dirID specifies
  861.                     a directory that's the object.
  862.  
  863.     __________
  864.     
  865.     See also:    FSpSetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
  866. */
  867.  
  868. /*****************************************************************************/
  869.  
  870. pascal    OSErr    FSpSetIsInvisible(const FSSpec *spec);
  871. /*    ¶ Set the invisible Finder Flag bit.
  872.     The FSpSetIsInvisible function sets the invisible bit in the fdFlags
  873.     word of the specified file or directory's finder information.
  874.     
  875.     spec    input:    An FSSpec record specifying the object.
  876.  
  877.     __________
  878.     
  879.     See also:    SetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
  880. */
  881.  
  882. /*****************************************************************************/
  883.  
  884. pascal    OSErr    ClearIsInvisible(short vRefNum,
  885.                                  long dirID,
  886.                                  StringPtr name);
  887. /*    ¶ Clear the invisible Finder Flag bit.
  888.     The ClearIsInvisible function clears the invisible bit in the fdFlags
  889.     word of the specified file or directory's finder information.
  890.     
  891.     vRefNum    input:    Volume specification.
  892.     dirID    input:    Directory ID.
  893.     name    input:    Pointer to object name, or nil when dirID specifies
  894.                     a directory that's the object.
  895.  
  896.     __________
  897.     
  898.     See also:    SetIsInvisible, FSpSetIsInvisible, FSpClearIsInvisible
  899. */
  900.  
  901. /*****************************************************************************/
  902.  
  903. pascal    OSErr    FSpClearIsInvisible(const FSSpec *spec);
  904. /*    ¶ Clear the invisible Finder Flag bit.
  905.     The FSpClearIsInvisible function clears the invisible bit in the fdFlags
  906.     word of the specified file or directory's finder information.
  907.     
  908.     spec    input:    An FSSpec record specifying the object.
  909.  
  910.     __________
  911.     
  912.     See also:    SetIsInvisible, FSpSetIsInvisible, ClearIsInvisible
  913. */
  914.  
  915. /*****************************************************************************/
  916.  
  917. pascal    OSErr    SetNameLocked(short vRefNum,
  918.                               long dirID,
  919.                               StringPtr name);
  920. /*    ¶ Set the nameLocked Finder Flag bit.
  921.     The SetNameLocked function sets the nameLocked bit in the fdFlags word
  922.     of the specified file or directory's finder information.
  923.     
  924.     vRefNum    input:    Volume specification.
  925.     dirID    input:    Directory ID.
  926.     name    input:    Pointer to object name, or nil when dirID specifies
  927.                     a directory that's the object.
  928.  
  929.     __________
  930.     
  931.     See also:    FSpSetNameLocked, ClearNameLocked, FSpClearNameLocked
  932. */
  933.  
  934. /*****************************************************************************/
  935.  
  936. pascal    OSErr    FSpSetNameLocked(const FSSpec *spec);
  937. /*    ¶ Set the nameLocked Finder Flag bit.
  938.     The FSpSetNameLocked function sets the nameLocked bit in the fdFlags word
  939.     of the specified file or directory's finder information.
  940.     
  941.     spec    input:    An FSSpec record specifying the object.
  942.  
  943.     __________
  944.     
  945.     See also:    SetNameLocked, ClearNameLocked, FSpClearNameLocked
  946. */
  947.  
  948. /*****************************************************************************/
  949.  
  950. pascal    OSErr    ClearNameLocked(short vRefNum,
  951.                                 long dirID,
  952.                                 StringPtr name);
  953. /*    ¶ Clear the nameLocked Finder Flag bit.
  954.     The ClearNameLocked function clears the nameLocked bit in the fdFlags
  955.     word of the specified file or directory's finder information.
  956.     
  957.     vRefNum    input:    Volume specification.
  958.     dirID    input:    Directory ID.
  959.     name    input:    Pointer to object name, or nil when dirID specifies
  960.                     a directory that's the object.
  961.  
  962.     __________
  963.     
  964.     See also:    SetNameLocked, FSpSetNameLocked, FSpClearNameLocked
  965. */
  966.  
  967. /*****************************************************************************/
  968.  
  969. pascal    OSErr    FSpClearNameLocked(const FSSpec *spec);
  970. /*    ¶ Clear the nameLocked Finder Flag bit.
  971.     The FSpClearNameLocked function clears the nameLocked bit in the fdFlags
  972.     word of the specified file or directory's finder information.
  973.     
  974.     spec    input:    An FSSpec record specifying the object.
  975.  
  976.     __________
  977.     
  978.     See also:    SetNameLocked, FSpSetNameLocked, ClearNameLocked
  979. */
  980.  
  981. /*****************************************************************************/
  982.  
  983. pascal    OSErr    SetIsStationery(short vRefNum,
  984.                                 long dirID,
  985.                                 ConstStr255Param name);
  986. /*    ¶ Set the isStationery Finder Flag bit.
  987.     The SetIsStationery function sets the isStationery bit in the
  988.     fdFlags word of the specified file or directory's finder information.
  989.     
  990.     vRefNum    input:    Volume specification.
  991.     dirID    input:    Directory ID.
  992.     name    input:    Pointer to object name, or nil when dirID specifies
  993.                     a directory that's the object.
  994.  
  995.     __________
  996.     
  997.     See also:    FSpSetIsStationery, ClearIsStationery, FSpClearIsStationery
  998. */
  999.  
  1000. /*****************************************************************************/
  1001.  
  1002. pascal    OSErr    FSpSetIsStationery(const FSSpec *spec);
  1003. /*    ¶ Set the isStationery Finder Flag bit.
  1004.     The FSpSetIsStationery function sets the isStationery bit in the
  1005.     fdFlags word of the specified file or directory's finder information.
  1006.     
  1007.     spec    input:    An FSSpec record specifying the object.
  1008.  
  1009.     __________
  1010.     
  1011.     See also:    SetIsStationery, ClearIsStationery, FSpClearIsStationery
  1012. */
  1013.  
  1014. /*****************************************************************************/
  1015.  
  1016. pascal    OSErr    ClearIsStationery(short vRefNum,
  1017.                                   long dirID,
  1018.                                   ConstStr255Param name);
  1019. /*    ¶ Clear the isStationery Finder Flag bit.
  1020.     The ClearIsStationery function clears the isStationery bit in the
  1021.     fdFlags word of the specified file or directory's finder information.
  1022.     
  1023.     vRefNum    input:    Volume specification.
  1024.     dirID    input:    Directory ID.
  1025.     name    input:    Pointer to object name, or nil when dirID specifies
  1026.                     a directory that's the object.
  1027.  
  1028.     __________
  1029.     
  1030.     See also:    SetIsStationery, FSpSetIsStationery, FSpClearIsStationery
  1031. */
  1032.  
  1033. /*****************************************************************************/
  1034.  
  1035. pascal    OSErr    FSpClearIsStationery(const FSSpec *spec);
  1036. /*    ¶ Clear the isStationery Finder Flag bit.
  1037.     The FSpClearIsStationery function clears the isStationery bit in the
  1038.     fdFlags word of the specified file or directory's finder information.
  1039.     
  1040.     spec    input:    An FSSpec record specifying the object.
  1041.  
  1042.     __________
  1043.     
  1044.     See also:    SetIsStationery, FSpSetIsStationery, ClearIsStationery
  1045. */
  1046.  
  1047. /*****************************************************************************/
  1048.  
  1049. pascal    OSErr    SetHasCustomIcon(short vRefNum,
  1050.                                  long dirID,
  1051.                                  StringPtr name);
  1052. /*    ¶ Set the hasCustomIcon Finder Flag bit.
  1053.     The SetHasCustomIcon function sets the hasCustomIcon bit in the
  1054.     fdFlags word of the specified file or directory's finder information.
  1055.     
  1056.     vRefNum    input:    Volume specification.
  1057.     dirID    input:    Directory ID.
  1058.     name    input:    Pointer to object name, or nil when dirID specifies
  1059.                     a directory that's the object.
  1060.  
  1061.     __________
  1062.     
  1063.     See also:    FSpSetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
  1064. */
  1065.  
  1066. /*****************************************************************************/
  1067.  
  1068. pascal    OSErr    FSpSetHasCustomIcon(const FSSpec *spec);
  1069. /*    ¶ Set the hasCustomIcon Finder Flag bit.
  1070.     The FSpSetHasCustomIcon function sets the hasCustomIcon bit in the
  1071.     fdFlags word of the specified file or directory's finder information.
  1072.     
  1073.     spec    input:    An FSSpec record specifying the object.
  1074.  
  1075.     __________
  1076.     
  1077.     See also:    SetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
  1078. */
  1079.  
  1080. /*****************************************************************************/
  1081.  
  1082. pascal    OSErr    ClearHasCustomIcon(short vRefNum,
  1083.                                    long dirID,
  1084.                                    StringPtr name);
  1085. /*    ¶ Clear the hasCustomIcon Finder Flag bit.
  1086.     The ClearHasCustomIcon function clears the hasCustomIcon bit in the
  1087.     fdFlags word of the specified file or directory's finder information.
  1088.     
  1089.     vRefNum    input:    Volume specification.
  1090.     dirID    input:    Directory ID.
  1091.     name    input:    Pointer to object name, or nil when dirID specifies
  1092.                     a directory that's the object.
  1093.  
  1094.     __________
  1095.     
  1096.     See also:    SetHasCustomIcon, FSpSetHasCustomIcon, FSpClearHasCustomIcon
  1097. */
  1098.  
  1099. /*****************************************************************************/
  1100.  
  1101. pascal    OSErr    FSpClearHasCustomIcon(const FSSpec *spec);
  1102. /*    ¶ Clear the hasCustomIcon Finder Flag bit.
  1103.     The FSpClearHasCustomIcon function clears the hasCustomIcon bit in the
  1104.     fdFlags word of the specified file or directory's finder information.
  1105.     
  1106.     spec    input:    An FSSpec record specifying the object.
  1107.  
  1108.     __________
  1109.     
  1110.     See also:    SetHasCustomIcon, FSpSetHasCustomIcon, ClearHasCustomIcon
  1111. */
  1112.  
  1113. /*****************************************************************************/
  1114.  
  1115. pascal    OSErr    ClearHasBeenInited(short vRefNum,
  1116.                                    long dirID,
  1117.                                    StringPtr name);
  1118. /*    ¶ Clear the hasBeenInited Finder Flag bit.
  1119.     The ClearHasBeenInited function clears the hasBeenInited bit in the
  1120.     fdFlags word of the specified file or directory's finder information.
  1121.     
  1122.     vRefNum    input:    Volume specification.
  1123.     dirID    input:    Directory ID.
  1124.     name    input:    Pointer to object name, or nil when dirID specifies
  1125.                     a directory that's the object.
  1126.  
  1127.     __________
  1128.     
  1129.     See also:    FSpClearHasBeenInited
  1130. */
  1131.  
  1132. /*****************************************************************************/
  1133.  
  1134. pascal    OSErr    FSpClearHasBeenInited(const FSSpec *spec);
  1135. /*    ¶ Clear the hasBeenInited Finder Flag bit.
  1136.     The FSpClearHasBeenInited function clears the hasBeenInited bit in the
  1137.     fdFlags word of the specified file or directory's finder information.
  1138.     
  1139.     spec    input:    An FSSpec record specifying the object.
  1140.  
  1141.     __________
  1142.     
  1143.     See also:    ClearHasBeenInited
  1144. */
  1145.  
  1146. /*****************************************************************************/
  1147.  
  1148. pascal    OSErr    CopyFileMgrAttributes(short srcVRefNum,
  1149.                                       long srcDirID,
  1150.                                       StringPtr srcName,
  1151.                                       short dstVRefNum,
  1152.                                       long dstDirID,
  1153.                                       StringPtr dstName,
  1154.                                       Boolean copyLockBit);
  1155. /*    ¶ Copy all File Manager attributes from the source to the destination.
  1156.     The CopyFileMgrAttributes function copies all File Manager attributes
  1157.     from the source file or directory to the destination file or directory.
  1158.     If copyLockBit is true, then set the locked state of the destination
  1159.     to match the source.
  1160.  
  1161.     srcVRefNum    input:    Source volume specification.
  1162.     srcDirID    input:    Source directory ID.
  1163.     srcName        input:    Pointer to source object name, or nil when
  1164.                         srcDirID specifies a directory that's the object.
  1165.     dstVRefNum    input:    Destination volume specification.
  1166.     dstDirID    input:    Destination directory ID.
  1167.     dstName        input:    Pointer to destination object name, or nil when
  1168.                         dstDirID specifies a directory that's the object.
  1169.     copyLockBit    input:    If true, set the locked state of the destination
  1170.                         to match the source.
  1171.  
  1172.     __________
  1173.     
  1174.     See also:    FSpCopyFileMgrAttributes
  1175. */
  1176.  
  1177. /*****************************************************************************/
  1178.  
  1179. pascal    OSErr    FSpCopyFileMgrAttributes(const FSSpec *srcSpec,
  1180.                                          const FSSpec *dstSpec,
  1181.                                          Boolean copyLockBit);
  1182. /*    ¶ Copy all File Manager attributes from the source to the destination.
  1183.     The FSpCopyFileMgrAttributes function copies all File Manager attributes
  1184.     from the source file or directory to the destination file or directory.
  1185.     If copyLockBit is true, then set the locked state of the destination
  1186.     to match the source.
  1187.  
  1188.     srcSpec        input:    An FSSpec record specifying the source object.
  1189.     dstSpec        input:    An FSSpec record specifying the destination object.
  1190.     copyLockBit    input:    If true, set the locked state of the destination
  1191.                         to match the source.
  1192.  
  1193.     __________
  1194.     
  1195.     See also:    CopyFileMgrAttributes
  1196. */
  1197.  
  1198. /*****************************************************************************/
  1199.  
  1200. pascal    OSErr    HOpenAware(short vRefNum,
  1201.                            long dirID,
  1202.                            ConstStr255Param fileName,
  1203.                            short denyModes,
  1204.                            short *refNum);
  1205. /*    ¶ Open the data fork of a file using deny mode permissions.
  1206.     The HOpenAware function opens the data fork of a file using deny mode
  1207.     permissions instead the normal File Manager permissions.  If OpenDeny
  1208.     is not available, then HOpenAware translates the deny modes to the
  1209.     closest File Manager permissions and tries to open the file with
  1210.     OpenDF first, and then Open if OpenDF isn't available. By using
  1211.     HOpenAware with deny mode permissions, a program can be "AppleShare
  1212.     aware" and fall back on the standard File Manager open calls
  1213.     automatically.
  1214.  
  1215.     vRefNum        input:    Volume specification.
  1216.     dirID        input:    Directory ID.
  1217.     fileName    input:    The name of the file.
  1218.     denyModes    input:    The deny modes access under which to open the file.
  1219.     refNum        output:    The file reference number of the opened file.
  1220.  
  1221.     __________
  1222.     
  1223.     See also:    FSpOpenAware, HOpenRFAware, FSpOpenRFAware
  1224. */
  1225.  
  1226. /*****************************************************************************/
  1227.  
  1228. pascal    OSErr    FSpOpenAware(const FSSpec *spec,
  1229.                              short denyModes,
  1230.                              short *refNum);
  1231. /*    ¶ Open the data fork of a file using deny mode permissions.
  1232.     The FSpOpenAware function opens the data fork of a file using deny mode
  1233.     permissions instead the normal File Manager permissions.  If OpenDeny
  1234.     is not available, then FSpOpenAware translates the deny modes to the
  1235.     closest File Manager permissions and tries to open the file with
  1236.     OpenDF first, and then Open if OpenDF isn't available. By using
  1237.     FSpOpenAware with deny mode permissions, a program can be "AppleShare
  1238.     aware" and fall back on the standard File Manager open calls
  1239.     automatically.
  1240.  
  1241.     spec        input:    An FSSpec record specifying the file.
  1242.     denyModes    input:    The deny modes access under which to open the file.
  1243.     refNum        output:    The file reference number of the opened file.
  1244.  
  1245.     __________
  1246.     
  1247.     See also:    HOpenAware, HOpenRFAware, FSpOpenRFAware
  1248. */
  1249.  
  1250. /*****************************************************************************/
  1251.  
  1252. pascal    OSErr    HOpenRFAware(short vRefNum,
  1253.                              long dirID,
  1254.                              ConstStr255Param fileName,
  1255.                              short denyModes,
  1256.                              short *refNum);
  1257. /*    ¶ Open the resource fork of a file using deny mode permissions.
  1258.     The HOpenRFAware function opens the resource fork of a file using deny
  1259.     mode permissions instead the normal File Manager permissions.  If
  1260.     OpenRFDeny is not available, then HOpenRFAware translates the deny
  1261.     modes to the closest File Manager permissions and tries to open the
  1262.     file with OpenRF. By using HOpenRFAware with deny mode permissions,
  1263.     a program can be "AppleShare aware" and fall back on the standard
  1264.     File Manager open calls automatically.
  1265.  
  1266.     vRefNum        input:    Volume specification.
  1267.     dirID        input:    Directory ID.
  1268.     fileName    input:    The name of the file.
  1269.     denyModes    input:    The deny modes access under which to open the file.
  1270.     refNum        output:    The file reference number of the opened file.
  1271.  
  1272.     __________
  1273.     
  1274.     See also:    HOpenAware, FSpOpenAware, FSpOpenRFAware
  1275. */
  1276.  
  1277. /*****************************************************************************/
  1278.  
  1279. pascal    OSErr    FSpOpenRFAware(const FSSpec *spec,
  1280.                                short denyModes,
  1281.                                short *refNum);
  1282. /*    ¶ Open the resource fork of a file using deny mode permissions.
  1283.     The FSpOpenRFAware function opens the resource fork of a file using deny
  1284.     mode permissions instead the normal File Manager permissions.  If
  1285.     OpenRFDeny is not available, then FSpOpenRFAware translates the deny
  1286.     modes to the closest File Manager permissions and tries to open the
  1287.     file with OpenRF. By using FSpOpenRFAware with deny mode permissions,
  1288.     a program can be "AppleShare aware" and fall back on the standard
  1289.     File Manager open calls automatically.
  1290.  
  1291.     spec        input:    An FSSpec record specifying the file.
  1292.     denyModes    input:    The deny modes access under which to open the file.
  1293.     refNum        output:    The file reference number of the opened file.
  1294.  
  1295.     __________
  1296.     
  1297.     See also:    HOpenAware, FSpOpenAware, HOpenRFAware
  1298. */
  1299.  
  1300. /*****************************************************************************/
  1301.  
  1302. pascal    OSErr    FSReadNoCache(short refNum,
  1303.                               long *count,
  1304.                               void *buffPtr);
  1305. /*    ¶ Read any number of bytes from an open file requesting no caching.
  1306.     The FSReadNoCache function reads any number of bytes from an open file
  1307.     while asking the file system to bypass its cache mechanism.
  1308.     
  1309.     refNum    input:    The file reference number of an open file.
  1310.     count    input:    The number of bytes to read.
  1311.             output:    The number of bytes actually read.
  1312.     buffPtr    input:    A pointer to the data buffer into which the bytes are
  1313.                     to be read.
  1314.  
  1315.     __________
  1316.     
  1317.     See also:    FSWriteNoCache
  1318. */
  1319.  
  1320. /*****************************************************************************/
  1321.  
  1322. pascal    OSErr    FSWriteNoCache(short refNum,
  1323.                                long *count,
  1324.                                const void *buffPtr);
  1325. /*    ¶ Write any number of bytes to an open file requesting no caching.
  1326.     The FSReadNoCache function writes any number of bytes to an open file
  1327.     while asking the file system to bypass its cache mechanism.
  1328.     
  1329.     refNum    input:    The file reference number of an open file.
  1330.     count    input:    The number of bytes to write to the file.
  1331.             output:    The number of bytes actually written.
  1332.     buffPtr    input:    A pointer to the data buffer from which the bytes are
  1333.                     to be written.
  1334.  
  1335.     __________
  1336.     
  1337.     See also:    FSReadNoCache
  1338. */
  1339.  
  1340.  
  1341. /*****************************************************************************/
  1342.  
  1343. pascal    OSErr    CopyFork(short srcRefNum,
  1344.                          short dstRefNum,
  1345.                          void *copyBufferPtr,
  1346.                          long copyBufferSize);
  1347. /*    ¶ Copy all data from the source fork to the destination fork of open file forks.
  1348.     The CopyFork function copies all data from the source fork to the
  1349.     destination fork of open file forks and makes sure the destination EOF
  1350.     is equal to the source EOF.
  1351.     
  1352.     srcRefNum        input:    The source file reference number.
  1353.     dstRefNum        input:    The destination file reference number.
  1354.     copyBufferPtr    input:    Pointer to buffer to use during copy. The
  1355.                             buffer should be at least 512-bytes minimum.
  1356.                             The larger the buffer, the faster the copy.
  1357.     copyBufferSize    input:    The size of the copy buffer.
  1358. */
  1359.  
  1360. /*****************************************************************************/
  1361.  
  1362. pascal    OSErr    GetFileLocation(short refNum,
  1363.                                 short *vRefNum,
  1364.                                 long *dirID,
  1365.                                 StringPtr fileName);
  1366. /*    ¶ Get the location of an open file.
  1367.     The GetFileLocation function gets the location (volume reference number,
  1368.     directory ID, and fileName) of an open file.
  1369.  
  1370.     refNum        input:    The file reference number of an open file.
  1371.     vRefNum        output:    The volume reference number.
  1372.     dirID        output:    The parent directory ID.
  1373.     fileName    input:    Points to a buffer (minimum Str63) where the
  1374.                         filename is to be returned or must be nil.
  1375.                 output:    The filename.
  1376.  
  1377.     __________
  1378.     
  1379.     See also:    FSpGetFileLocation
  1380. */
  1381.  
  1382. /*****************************************************************************/
  1383.  
  1384. pascal    OSErr    FSpGetFileLocation(short refNum,
  1385.                                    FSSpec *spec);
  1386. /*    ¶ Get the location of an open file in an FSSpec record.
  1387.     The FSpGetFileLocation function gets the location of an open file in
  1388.     an FSSpec record.
  1389.  
  1390.     refNum        input:    The file reference number of an open file.
  1391.     spec        output:    FSSpec record containing the file name and location.
  1392.  
  1393.     __________
  1394.     
  1395.     See also:    GetFileLocation
  1396. */
  1397.  
  1398. /*****************************************************************************/
  1399.  
  1400. pascal    OSErr    CopyDirectoryAccess(short srcVRefNum,
  1401.                                     long srcDirID,
  1402.                                     StringPtr srcName,
  1403.                                     short dstVRefNum,
  1404.                                     long dstDirID,
  1405.                                     StringPtr dstName);
  1406. /*    ¶ Copy the AFP directory access privileges.
  1407.     The CopyDirectoryAccess function copies the AFP directory access
  1408.     privileges from one directory to another. Both directories must be on
  1409.     the same file server, but not necessarily on the same server volume.
  1410.     
  1411.     srcVRefNum    input:    Source volume specification.
  1412.     srcDirID    input:    Source directory ID.
  1413.     srcName        input:    Pointer to source directory name, or nil when
  1414.                         srcDirID specifies the directory.
  1415.     dstVRefNum    input:    Destination volume specification.
  1416.     dstDirID    input:    Destination directory ID.
  1417.     dstName        input:    Pointer to destination directory name, or nil when
  1418.                         dstDirID specifies the directory.
  1419.  
  1420.     __________
  1421.     
  1422.     See also:    FSpCopyDirectoryAccess
  1423. */
  1424.  
  1425. /*****************************************************************************/
  1426.  
  1427. pascal    OSErr    FSpCopyDirectoryAccess(const FSSpec *srcSpec,
  1428.                                        const FSSpec *dstSpec);
  1429. /*    ¶ Copy the AFP directory access privileges.
  1430.     The FSpCopyDirectoryAccess function copies the AFP directory access
  1431.     privileges from one directory to another. Both directories must be on
  1432.     the same file server, but not necessarily on the same server volume.
  1433.  
  1434.     srcSpec        input:    An FSSpec record specifying the source directory.
  1435.     dstSpec        input:    An FSSpec record specifying the destination directory.
  1436.  
  1437.     __________
  1438.     
  1439.     See also:    CopyDirectoryAccess
  1440. */
  1441.  
  1442. /*****************************************************************************/
  1443.  
  1444. pascal    OSErr    HMoveRenameCompat(short vRefNum,
  1445.                                   long srcDirID,
  1446.                                   ConstStr255Param srcName,
  1447.                                   long dstDirID,
  1448.                                   StringPtr dstpathName,
  1449.                                   StringPtr copyName);
  1450. /*    ¶ Move a file or directory and optionally rename it.
  1451.     The HMoveRenameCompat function moves a file or directory and optionally
  1452.     renames it.  The source and destination locations must be on the same
  1453.     volume. This routine works even if the volume doesn't support MoveRename.
  1454.     
  1455.     vRefNum        input:    Volume specification.
  1456.     srcDirID    input:    Source directory ID.
  1457.     srcName        input:    The source object name.
  1458.     dstDirID    input:    Destination directory ID.
  1459.     dstName        input:    Pointer to destination directory name, or
  1460.                         nil when dstDirID specifies a directory.
  1461.     copyName    input:    Points to the new name if the object is to be
  1462.                         renamed or nil if the object isn't to be renamed.
  1463.  
  1464.     __________
  1465.     
  1466.     See also:    FSpMoveRenameCompat
  1467. */
  1468.  
  1469. /*****************************************************************************/
  1470.  
  1471. pascal    OSErr    FSpMoveRenameCompat(const FSSpec *srcSpec,
  1472.                                     const FSSpec *dstSpec,
  1473.                                     StringPtr copyName);
  1474. /*    ¶ Move a file or directory and optionally rename it.
  1475.     The FSpMoveRenameCompat function moves a file or directory and optionally
  1476.     renames it.  The source and destination locations must be on the same
  1477.     volume. This routine works even if the volume doesn't support MoveRename.
  1478.     
  1479.     srcSpec        input:    An FSSpec record specifying the source object.
  1480.     dstSpec        input:    An FSSpec record specifying the destination
  1481.                         directory.
  1482.     copyName    input:    Points to the new name if the object is to be
  1483.                         renamed or nil if the object isn't to be renamed.
  1484.  
  1485.     __________
  1486.     
  1487.     See also:    HMoveRenameCompat
  1488. */
  1489.  
  1490. /*****************************************************************************/
  1491.  
  1492. pascal    void    BuildAFPVolMountInfo(short theFlags,
  1493.                                      char theNBPInterval,
  1494.                                      char theNBPCount,
  1495.                                      short theUAMType,
  1496.                                      Str31 theZoneName,
  1497.                                      Str31 theServerName,
  1498.                                      Str27 theVolName,
  1499.                                      Str31 theUserName,
  1500.                                      Str8 theUserPassWord,
  1501.                                      Str8 theVolPassWord,
  1502.                                      MyAFPVolMountInfoPtr theAFPInfo);
  1503. /*    ¶ Initialize the fields of an AFPVolMountInfo record.
  1504.     The BuildAFPVolMountInfo function initializes the fields of an
  1505.     AFPVolMountInfo record for use before using that record to call
  1506.     the VolumeMount function.
  1507.     
  1508.     theFlags        input:    The AFP mounting flags. 0 = normal mount;
  1509.                             set bit 0 to inhibit greeting messages.
  1510.     theNBPInterval    input:    The interval used for VolumeMount's
  1511.                             NBP Lookup call. 7 is a good choice.
  1512.     theNBPCount        input:    The retry count used for VolumeMount's
  1513.                             NBP Lookup call. 5 is a good choice.
  1514.     theUAMType        input:    The user authentication method to use.
  1515.     theZoneName        input:    The AppleTalk zone name of the server.
  1516.     theServerName    input:    The AFP server name.
  1517.     theVolName        input:    The AFP volume name.
  1518.     theUserName        input:    The user name (zero length Pascal string for
  1519.                             guest).
  1520.     theUserPassWord    input:    The user password (zero length Pascal string
  1521.                             if no user password)
  1522.     theVolPassWord    input:    The volume password (zero length Pascal string
  1523.                             if no volume password)
  1524.     theAFPInfo        input:    Pointer to AFPVolMountInfo record to
  1525.                             initialize.
  1526.  
  1527.     __________
  1528.     
  1529.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  1530.                 RetrieveAFPVolMountInfo
  1531. */
  1532.  
  1533. /*****************************************************************************/
  1534.  
  1535. pascal    OSErr    RetrieveAFPVolMountInfo(AFPVolMountInfoPtr theAFPInfo,
  1536.                                         short *theFlags,
  1537.                                         short *theUAMType,
  1538.                                         StringPtr theZoneName,
  1539.                                         StringPtr theServerName,
  1540.                                         StringPtr theVolName,
  1541.                                         StringPtr theUserName);
  1542. /*    ¶ Retrieve the AFP mounting information from an AFPVolMountInfo record.
  1543.     The RetrieveAFPVolMountInfo function retrieves the AFP mounting
  1544.     information returned in an AFPVolMountInfo record by the
  1545.     GetVolMountInfo function.
  1546.     
  1547.     theAFPInfo        input:    Pointer to AFPVolMountInfo record that contains
  1548.                             the AFP mounting information.
  1549.     theFlags        output:    The AFP mounting flags. 0 = normal mount;
  1550.                             if bit 0 is set, greeting meesages were inhibited.
  1551.     theUAMType        output:    The user authentication method used.
  1552.     theZoneName        output:    The AppleTalk zone name of the server.
  1553.     theServerName    output:    The AFP server name.
  1554.     theVolName        output:    The AFP volume name.
  1555.     theUserName        output:    The user name (zero length Pascal string for
  1556.                             guest).
  1557.  
  1558.     __________
  1559.     
  1560.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  1561.                 BuildAFPVolMountInfo
  1562. */
  1563.  
  1564. /*****************************************************************************/
  1565.  
  1566. pascal    OSErr    GetUGEntries(short objType,
  1567.                              UGEntryPtr entries,
  1568.                              long reqEntryCount,
  1569.                              long *actEntryCount,
  1570.                              long *objID);
  1571. /*    ¶ Retrieve a list of user or group entries from the local file server.
  1572.     The GetUGEntries functions retrieves a list of user or group entries
  1573.     fromthe local file server.
  1574.  
  1575.     objType            input:    The object type: -1 = group; 0 = user
  1576.     UGEntries        input:    Pointer to array of UGEntry records where the list
  1577.                             is returned.
  1578.     reqEntryCount    input:    The number of elements in the UGEntries array.
  1579.     actEntryCount    output:    The number of entries returned.
  1580.     objID            input:    The current index position. Set to 0 to start with
  1581.                             the first entry.
  1582.                     output:    The index position to get the next entry. Pass this
  1583.                             value the next time you call GetUGEntries to start
  1584.                             where you left off.
  1585.  
  1586.     __________
  1587.     
  1588.     Also see:    GetUGEntry
  1589. */
  1590.  
  1591. /*****************************************************************************/
  1592.  
  1593. #endif
  1594.